<HTML>
<BODY BGCOLOR=white>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->
NAME
     lAddElemStr, lDelElemStr, lGetElemStr - list operations
     lAddSubStr, lDelSubStr, lGetSubStr - sub-list operations

SYNOPSIS
     #include "cull.h"

     lListElem* lAddElemStr(
          lList** lpp,
          int nm,
          char *s,
          lDescr *dp
     );

     int lDelElemStr(
          lList** lpp,
          int nm,
          char *s
     );

     lListElem *lGetElemStr(
          lList* lp,
          int nm,
          char *s
     );

     lListElem* lAddSubStr(
          lListElem* ep,
          int nm,
          char *s,
          B
          int snm,
          lDescr *dp
     );

     int lDelSubStr(
          lListElem* ep,
          int nm,
          char *s,
          int snm
     );

     lListElem *lGetSubStr(
          lListElem* ep,
          int nm,
          char *s,
          int snm
     );

     lListElem *lDiffListStr(
          int nm,
          lList** lpp1,
          lList** lpp1,
     );

DESCRIPTION
     lListElem *lAddElemStr(lpp, nm, s, dp)
          Appends an element to the list *lpp.  The  new  element
          gets  the  type dp (using <B><A HREF="../htmlman3/lCreateElem.html">lCreateElem(3)</A></B>).  Field nm of
          the  new  elements  gets  the  value  s  (using   <I>lSet-</I>
          <B><A HREF="../htmlman3/String.html">String(3)</A></B>).   No  test are made to ensure uniqueness of
          elements in the list. If *lpp is NULL a new  list  head
          gets  created  (using  <B><A HREF="../htmlman3/lCreateList.html">lCreateList(3)</A></B>).   lAddElemStr()
          fails if the given list or descriptor has no field nm.

     int lDelElemStr(lpp, nm, s)
          Removes one element containing s at  field  nm  in  the
          list *lpp.  <I>lGetElemStr</I> is used to find the element. It
          gets unchained and freed. If no more  elements  are  in
          the  list after unchaining the list head gets freed and
          NULL is written to  *lpp.   <I>lDelElemStr</I>  fails  if  the
          given list has no field nm.

     lListElem *lGetElemStr(lp, nm, s)
          Searches the first element containing s at field nm  in
          the  list lp.  <B><A HREF="../htmlman3/strcmp.html">strcmp(3)</A></B> s used to perform the compare.
          <I>lGetElemStr</I> returns the element.

     lListElem *lAddSubStr(ep, nm, s, snm, dp)
          Uses <I>lAddElemStr</I> to append an element to  the  sub-list
          field snm of the element ep.

     int lDelSubStr(ep, nm, s, snm)
          Uses <I>lDelElemStr</I> to remove an element from the sub-list
          field snm of the element ep.

     lListElem *lGetSubStr(ep, nm, s, snm)
          Uses <I>lGetElemStr</I> to find an  element  in  the  sub-list
          field snm of the element ep.

     int lDiffListStr(nm, lpp1, lpp2)
          <I>lDiffListStr</I> removes and frees elements in  <I>both</I>  lists
          with the same string key in field nm.

EXAMPLES
     The first example shows the usage of list functions:

     =======================================================================

     #include "cull.h"

     f()
     {
          lList *lp = NULL;
          lListElem *ep;

          /* add a queue element where QU_qname is "balin.q" to the list lp */
          if (!(ep=lAddElemStr(&amp;lp, QU_qname, "balin.q", QU_Type))) {
               /* ... */
          }
          lSetString(ep, QU_qhostname, "balin.mydomain");

          /* get the element of lp where QU_qname is "balin.q" */
          if (!(ep=lGetElemStr(lp, QU_qname, "balin.q"))) {
               /* ... */
          }

          /* remove the element of lp where QU_qname is "balin.q" */
          if (!lDelElemStr(&amp;lp, QU_qname, "balin.q")) {
               /* ... */
          }

          /* here lp will be NULL again */

          return;
     }

     =======================================================================

     The second example shows the usage of sub-list functions:

     =======================================================================

     #include "cull.h"

     g(queue)
     lListElem *queue;
     {
          lListElem *ep;

          /* add an owner element with OW_name "bill" to the */
          /* sub-list QU_ownerlist of the element ep          */
          ep = lAddSubStr(ep, OW_name, "bill", QU_ownerlist, OW_Type);
          if ( !ep ) {
               /* ... */
          }
          lSetString(ep, OW_permissions, "everything");

          /* get the element in the sub-list QU_ownerlist of  */
          /* the element ep where OW_name is "bill"          */
          if (!(ep=lGetSubStr(ep, OW_name, "bill", QU_ownerlist))) {
               /* ... */
          }
          printf("Owner: %s0, lGetString(ep, OW_name));

          /* remove the element in the sub-list of element ep */
          /* where OW_name is "bill"                         */
          if (!lDelSubStr(ep, OW_name, "bill", QU_ownerlist)) {
               /* ... */
          }

          return;
     }

     =======================================================================


RETURN VALUES
     <I>lAddElemStr</I> and <I>lAddSubStr</I> return a  pointer  to  the  added
     list  element  or NULL on error.  <I>lDelElemStr</I> and <I>lDelSubStr</I>
     return 1 on success and 0 on error.  <I>lGetElemStr</I>  and  <I>lGet-</I>
     <I>SubStr</I> return a pointer to the found list element or NULL on
     error.  <I>lDiffListStr</I> returns 0 on success and -1 on error.

SEE ALSO
     <B><A HREF="../htmlman1/sge_intro.html">sge_intro(1)</A></B>, <B><A HREF="../htmlman3/list_intro.html">list_intro(3)</A></B>,  <B><A HREF="../htmlman3/lSetString.html">lSetString(3)</A></B>,  <B><A HREF="../htmlman3/lGetString.html">lGetString(3)</A></B>,
     <B><A HREF="../htmlman3/lAppendElem.html">lAppendElem(3)</A></B>,  <B><A HREF="../htmlman3/lDechainElem.html">lDechainElem(3)</A></B>,  <B><A HREF="../htmlman3/lCreateElem.html">lCreateElem(3)</A></B>, <I>lCreateL-</I>
     <B><A HREF="../htmlman3/ist.html">ist(3)</A></B>.

COPYRIGHT
     See <B><A HREF="../htmlman1/sge_intro.html">sge_intro(1)</A></B> for a full statement of rights and  permis-
     sions.


























</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>
